package com.lg.partition19;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author `RKC`
 * @date 2022/3/18 9:25
 */
public class P1879CornFieldsG {

    private static final int N = 15, MOD = 100000000;
    private static int[] g = new int[N];
    private static int[][] f = new int[N][1 << N];
    private static Map<Integer, List<Integer>> map = new HashMap<>(1 << N);
    private static int n, m;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        n = Integer.parseInt(ss[0]);
        m = Integer.parseInt(ss[1]);
        for (int i = 1; i <= n; i++) {
            ss = reader.readLine().split(" ");
            for (int j = 0; j < m; j++) {
                if (Integer.parseInt(ss[j]) == 0) g[i] |= 1 << j;
            }
        }
        //单行合法状态
        for (int i = 0; i < 1 << m; i++) {
            if ((i & i << 1) != 0) continue;
            map.put(i, new ArrayList<>());
        }
        for (Map.Entry<Integer, List<Integer>> entry : map.entrySet()) {
            int cur = entry.getKey();
            List<Integer> ls = entry.getValue();
            for (int prev : map.keySet()) {
                if ((cur & prev) != 0) continue;
                ls.add(prev);
            }
        }
        f[0][0] = 1;
        for (int i = 1; i <= n + 1; i++) {
            for (Map.Entry<Integer, List<Integer>> entry : map.entrySet()) {
                int cur = entry.getKey();
                if ((g[i] & cur) != 0) continue;
                List<Integer> ls = entry.getValue();
                for (int prev : ls) {
                    f[i][cur] = (f[i][cur] + f[i - 1][prev]) % MOD;
                }
            }
        }
        writer.write(f[n + 1][0] + "\n");
        writer.flush();
    }
}
